package com.tiancheng.trade.order.vo.api;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 退款参数
 *
 * @author kellen
 * @date 2024/3/24
 */
@Getter
@Setter
public class RefundVO {

    // 用户id
    @NotEmpty
    private String uid;

    // 主订单号
    @NotEmpty
    private String orderId;

    // 申请时间
    @NotNull
    private LocalDateTime createTime;

    // 退款原因
    @NotEmpty
    private String refundReason;

    @Valid
    @NotEmpty
    private List<SubOrder> subOrders;

    /**
     * 订单业务类型 ： 传入 overseas 走英文版订单流程
     * */
    private String orderBusiness;

    @Getter
    @Setter
    public static class SubOrder {

        @NotEmpty
        private String subOrderId;
        private Integer refundAmount;
    }
}
